package com.qifei.xmlg_backend.controller;

import com.qifei.xmlg_backend.entity.JobCount;
import com.qifei.xmlg_backend.entity.Result;
import com.qifei.xmlg_backend.service.IJobService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * 职位
 *  前端控制器
 *
 *
 * @author job
 * @since 2025-06-16
 */
@RestController
@RequestMapping("/jobs")
@RequiredArgsConstructor
public class JobController {

    private final IJobService iJobService;

    /**
     * 查看全部职位的人数*/
    @GetMapping
    public Result<?> getJobCountList(){
        JobCount countList = iJobService.getCountList();
        if (countList != null){
            return Result.success(countList);
        }
        return Result.error("获取职位统计信息失败");
    }
}
